import React from "react"

const Home =React.lazy(()=>import('../pages/Home'))
const Detail =React.lazy(()=>import('../pages/Detail'))
const Order =React.lazy(()=>import('../pages/Order'))
const Shop =React.lazy(()=>import('../pages/Shop'))
const Layout=React.lazy(()=>import('../Layout'))

const menuRouter=[{
    path:'/main/home',
    name:'主页',
    element:<Home/>
},{
    path:'/main/order',
    name:'订单管理',
    element:<Order/>
},{
    path:'/main/shop',
    name:'商品页面',
    element:<Shop/>
}]

const routes=[{
    path:'/main',
    element:<Layout/>,
    children:menuRouter
},{
    path:'/detail:id',
    element:<Detail/>,
},{
    from:'/',
    to:'/main/order'
}]

export {routes,menuRouter} 